<template>
    <van-button class="add-button" icon="plus" type="primary" @click="doAddTeam"></van-button>
    <team-card-list :team-list="teamList"></team-card-list>

</template>

<script setup lang="ts">
    import {useRouter} from 'vue-router'
    import TeamCardList from '../components/TeamCardList.vue'
    import {onMounted,ref} from "vue";
    import myAxois from "../plugin/MyAxios";
    import {showFailToast, showSuccessToast} from "vant";

    const doAddTeam = () =>{
        router.push({
            path:"/team/add"
        })
    }

    const router = useRouter();
    const teamList = ref([]);
    onMounted(async () =>{
        const res = await myAxois.get("/team/list/my/create");
        if(res.data.code === 0){
            teamList.value = res.data.data;
        }else{
            showFailToast("获取失败")
        }
    })

</script>

<style scoped>

</style>